﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.Linq;
using System.Threading;


namespace TerrariaSVCv2 {
    [RunInstaller(true)]
    public partial class ProjectInstaller : System.Configuration.Install.Installer {
        public ProjectInstaller() {
            InitializeComponent();
        }

        private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e) {
            try {
                SplunkWrapper.SplunkArgs splunkArgs = new SplunkWrapper.SplunkArgs();
                splunkArgs.HostIP = "192.168.1.109";
                splunkArgs.Port = 16948;
                splunkArgs.Message = "Terraria as a service, installed.";
                ThreadPool.QueueUserWorkItem(new WaitCallback(SplunkWrapper.SendToSplunk), splunkArgs);
            } catch (Exception err) { }
        }
    }
}
